package com.ym.domain.controller;

import com.ym.domain.common.base.Result;
import com.ym.domain.model.bo.CusRegisterBo;
import com.ym.domain.model.bo.LoginBo;
import com.ym.domain.service.CusCustomerBizService;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/customer")
@Validated
public class CusCustomerController {

    @Autowired
    private CusCustomerBizService customerBizService;

    // 客户注册
    @PostMapping("/registerCustomer")
    public Result registerCustomer(@RequestBody @Valid CusRegisterBo bo) {
        return customerBizService.registerCustomer(bo);
    }

    @PostMapping(value = "/login")
    public Result login(@RequestBody @Valid LoginBo bo) {
        return customerBizService.login(bo);
    }

    // ------------------------------- 以下为测试 -------------------------------

    @GetMapping("/mydis")
    public void mydis() {
        customerBizService.mydis();
    }

}
